﻿<%@ Page Language="C#" MasterPageFile="~/Template.master" AutoEventWireup="true" CodeFile="CauHinhMail.aspx.cs" Inherits="Admin_CauHinhMail" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <script type="text/javascript">
    $(document).ready(function(){
        
        
        $("#txthopthu").attr("value",box);
        $("#txtserver").attr("value",smtp);
        $("#txtusername1").attr("value",namelog);
        $("#txtpassword1").attr("value",passlog);
        $("#update").click(function(){
            var hopthu=$("#txthopthu").attr("value");
            var server=$("#txtserver").attr("value");
            var name=$("#txtusername1").attr("value");
            var passmail=$("#txtpassword1").attr("value");
            var url="../Controllers/xlUpdateMail.aspx?time=" + (new Date()).getTime();
            url+="&hopthu="+hopthu;
            url+="&server="+server;
            url+="&name="+name;
            url+="&pass="+passmail;
            jQuery.get(url,function(res){
            
                if(res=="True")
                {
                    alert("Cấu hình thành công");
                   
                }
                else
                    alert("Cấu hình bị lỗi");
            });
        });
        $("#cancel").click(function(){
            window.location="Default.aspx";
        });
    });
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="font-weight:bold; width: 320px;" border="0" align="center" 
                         cellpadding="4" cellspacing="0">
                      <tr align="center">
                        <td colspan="2" class="table_header">Cấu Hình Mail Server</td>
                      </tr>
                      <tr>
                        <td>Tên hộp thư:</td>
                        <td><input type="text" id='txthopthu'  /> </td>
                      </tr>
                      <tr>
                        <td>SMTP Server:</td>
                        <td><input type='text' id='txtserver' /> </td>
                      </tr>
                      <tr>
                        <td>Username:</td>
                        <td><input type="text" id='txtusername1'  /> </td>
                      </tr>
                       <tr>
                        <td>Password:</td>
                        <td><input type="text" id='txtpassword1' /> </td>
                      </tr>
                      <tr>
                        <td>
                            <input type="button" id='update' value='Cập Nhật' />
                        </td>
                        <td>
                            <input type="button" id='cancel' value='Huỷ' />
                        </td>
                      </tr>
                      
                      </table>
</asp:Content>

